#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int A[15];
void chai(ll x){
    int pos = 0;
    while (x){
        ++pos;
        A[pos] = x%10;
        x/=10;
    }
}

ll count(long long x){
    if(x<0) return 0;
    chai(x);
    ll ans = 0;
    for (int i = 1; i <= 10; ++i) {
        ll a = x/(ll)pow(10,i);
        ll b = x%(ll)pow(10,i-1);
        if(!a) break;
        if(A[i] == 0){
            ans += (a-1)*(ll)pow(10, i-1);
            ans += b+1;
        }else{
            ans += a*pow(10, i-1);
        }
    }
    return ans+1;
}

int main() {
    ios::sync_with_stdio(false);cin.tie(nullptr);
    long long a, b;
    while (cin >> a >> b && a>=0 && b>=0){
        ll ca = count(a-1), cb = count(b);
        cout << cb - ca << endl;
    }
    return 0;
}